home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Games / Chess / Source / ResponseMeter.m < prev    next >
Text File  |  1994-04-01  |  770b  |  53 lines

  1. #import <appkit/appkit.h>
  2. #import "ResponseMeter.h"
  3.  
  4. #import "gnuchess.h"
  5.  
  6. @implementation ResponseMeter
  7.  
  8. - displayFilled
  9. {
  10.   [self lockFocus];
  11.   PSgsave();
  12.  
  13.   PSsetgray( NX_WHITE );
  14.   PSclippath();
  15.   PSfill();
  16.  
  17.   PSsetlinewidth( 2.0 );
  18.   PSsetgray( NX_BLACK );
  19.   PSclippath();
  20.   PSstroke();
  21.   
  22.   PSgrestore();
  23.   
  24.   PSflushgraphics();
  25.   NXPing();
  26.   
  27.   [self unlockFocus];
  28. }
  29.  
  30. - drawSelf:(const NXRect *)f :(int)rectCount
  31. {
  32.   PSgsave();
  33.   PSsetgray( 0.5 );
  34.   PSclippath();
  35.   PSfill();
  36.  
  37.   if( (ResponseTime+ExtraTime) ){  
  38.     PSsetgray( NX_WHITE );
  39.     PSrectfill( 0.0, 0.0, 
  40.                 et*(f->size.width/(ResponseTime+ExtraTime)), f->size.height );
  41.   }
  42.   
  43.   PSsetlinewidth( 2.0 );
  44.   PSsetgray( NX_BLACK );
  45.   PSclippath();
  46.   PSstroke();
  47.   
  48.   PSgrestore();
  49. }
  50.  
  51. @end
  52.   
  53.